package com.aidex.biz.service.impl;

import java.util.List;
import com.aidex.common.annotation.DataScope;
import com.github.pagehelper.PageInfo;
import com.aidex.common.core.domain.entity.SysUser;
import com.aidex.common.core.domain.entity.SysDept;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.framework.cache.DeptUtils;
import com.aidex.framework.cache.UserUtils;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.aidex.biz.mapper.DeptTargetMapper;
import com.aidex.biz.domain.DeptTarget;
import com.aidex.biz.service.DeptTargetService;
import org.springframework.transaction.annotation.Transactional;
import com.aidex.common.utils.NumberUtils;

/**
 * 业绩目标设置Service业务层处理
 * @author sean
 * @email 2074844820@qq.com
 * @date 2024-09-24
 */
@Service
@Transactional(readOnly = true)
public class DeptTargetServiceImpl extends BaseServiceImpl<DeptTargetMapper, DeptTarget> implements DeptTargetService
{
    private static final Logger log = LoggerFactory.getLogger(DeptTargetServiceImpl.class);

    /**
     * 获取单条数据
     * @param deptTarget 业绩目标设置
     * @return 业绩目标设置
     */
    @Override
    public DeptTarget get(DeptTarget deptTarget)
    {
        DeptTarget dto = super.get(deptTarget);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 业绩目标设置id
     * @return 业绩目标设置
     */
    @Override
    public DeptTarget get(String id)
    {
        DeptTarget dto = super.get(id);
        return dto;
    }


    /**
     * 查询业绩目标设置列表
     * @param deptTarget 业绩目标设置
     * @return 业绩目标设置
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public List<DeptTarget> findList(DeptTarget deptTarget)
    {
        return super.findList(deptTarget);
    }

    /**
     * 分页查询业绩目标设置列表
     * @param deptTarget 业绩目标设置
     * @return 业绩目标设置
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public PageInfo<DeptTarget> findPage(DeptTarget deptTarget)
    {
        return super.findPage(deptTarget);
    }

    /**
     * 保存业绩目标设置
     * @param deptTarget
     * @return 结果
     */
    @Override
    public boolean save(DeptTarget deptTarget)
    {
        return super.save(deptTarget);
    }


    /**
     * 删除业绩目标设置信息
     * @param deptTarget
     * @return 结果
     */
    @Override
    public boolean remove(DeptTarget deptTarget)
    {
        return super.remove(deptTarget);
    }

    /**
     * 批量删除业绩目标设置
     * @param ids 需要删除的业绩目标设置ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteDeptTargetByIds(String[] ids)
    {
        return mapper.deleteDeptTargetByIds(ids);
    }

    /**
     * 获取最大编号
     * @param deptTarget 业绩目标设置
     * @return 结果
     */
    @Override
    public int findMaxSort(DeptTarget deptTarget)
    {
        return NumberUtils.nextOrder(mapper.findMaxSort(deptTarget));
    }

    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public DeptTarget getIndexDeptTarGet(DeptTarget deptTarget) {
        return mapper.getIndexDeptTarGet(deptTarget);
    }
}
